<?php
/**
* @author Bimal Poudel
* @package Smarty Framework
* @support http://www.odesk.com/users/~~dd91d11caed0cdce
* @contact http://www.sanjaal.com
* @company Sanjaal Corps
*/

require_once('inc.config.php');

# read images
# read sizes
# resize each images in each sizes under their folders

$sizes = array(
	array(100, 200),
	array(100, 300),
	array(200, 150),
	array(200, 200),
	array(300, 200),
	array(300, 400),
	array(200, 400),
);

$original_images = glob('originals/*.jpg');

foreach($original_images as $oi => $original_image)
{
	foreach($sizes as $s => $size)
	{
		$image = basename($original_image);
		
		$cropnail = new cropnail($size[0], $size[1]);
		$cropnail->resize($original_image, "cropnails/size{$s}-{$image}", $crop_pattern);
	}
}

# See reports
header('Location: examples/diretory-multiple.php');
?>